﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddWarnInfo.aspx.cs" Inherits="dzs.Web.supply.AddWarnInfo"  EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             //alert($("#txtmaterialInfo").text());
             $("#txtmaterialInfo").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../GetMaterialInfo.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         </script>
</head>
<body style="font-size: 9pt;">
    <form id="form1" runat="server">
    <div>
    <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
        <tr>
            <td class="tdbg">
                <table cellspacing="0" cellpadding="0" width="100%" border="0">
                    <tr>
                        <td height="25" width="30%" align="right">
                            物料名称 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtmaterialInfo" runat="server" Width="200px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="30%" align="right">
                            最小预警数量 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtminNums" runat="server" Width="58px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                ControlToValidate="txtminNums" ErrorMessage="请输入数字" 
                                ValidationExpression="^[+|-]{0,1}(\d*)\.{0,1}\d{0,}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="30%" align="right">
                            最大预警数量 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtmaxNums" runat="server" Width="58px"></asp:TextBox>
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                                ControlToValidate="txtmaxNums" ErrorMessage="请输入数字" 
                                ValidationExpression="^[+|-]{0,1}(\d*)\.{0,1}\d{0,}$"></asp:RegularExpressionValidator>
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="30%" align="right">
                            预警时间 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:TextBox ID="txtwarnTime" runat="server" Width="58px"></asp:TextBox>
                            &nbsp;（单位：个月）
                        </td>
                    </tr>
                    <tr>
                        <td height="25" width="30%" align="right">
                            所属仓管员 ：
                        </td>
                        <td height="25" width="*" align="left">
                            <asp:DropDownList ID="ddl_cguid" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="tdbg" align="center" valign="bottom">
                <asp:Button ID="btnSave" runat="server" Text="保  存" OnClick="btnSave_Click" Width="120px"></asp:Button>
            </td>
        </tr>
    </table>
    <br />
</div>
</form>
</body></html>
